<template>
  <div class="add_task" v-if="show">
    <h2>编辑任务</h2>
    <p><input type="text" placeholder="任务标题" v-model="task_data['taskTitle']"/></p>
    <p><input type="text" placeholder="任务描述" v-model="task_data['taskContent']" /></p>
    <p>
        
       <input type="datetime-local" placeholder="开始时间" v-model="task_data['startTime']" :max="task_data['deadLine']"/> 
    </p>
    <p>
      <input type="datetime-local" placeholder="截止时间" v-model="task_data['deadLine']" :min="task_data['startTime']"/>
    </p>
    <label><button class="click_bt" @click="editTaskConfir">确认</button></label>
    <label><button class="click_bt" @click="close">取消</button></label>
  </div>
</template>

<script>
export default {
  name: "EditTask",
  props: ["show","task_data"],
  inject:['reload'],
  data() {
    return {
      task:this.task_data
    };
  },
  methods: {
    close() {
      this.$emit("update:show",false)
    },
    editTaskConfir() {
      this.$emit("editDone")
      this.$emit("update:show",false)
    },
  },
};
</script>

<style scoped>
.add_task {
  padding: 10px 0 40px 0;
}
.add_task p input {
  width: 75%;
  height: 20px;
  font-size: 15px;
}
.add_task label button {
  font-size: 18px;
  margin: 0 20px;
}
</style>